Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all proposed Keyboard shortcuts #451

Merged
merged 5 commits into from
Oct 11, 2024

Conversation

arjxn-py
Copy link
Member

@arjxn-py arjxn-py commented Oct 6, 2024

Should close #396
Should also close #458

Trust me! I'm pressing the keybinding while being on the the notebook 😇

keys.mov

@arjxn-py arjxn-py added enhancement New feature or request UX improvement labels Oct 6, 2024
Copy link
Contributor

github-actions bot commented Oct 6, 2024

Preview PR at appsharing.space

Copy link
Contributor

github-actions bot commented Oct 6, 2024

Integration tests repot: appsharing.space

packages/base/src/keybindings.json Outdated Show resolved Hide resolved
packages/base/src/keybindings.json Outdated Show resolved Hide resolved
Comment on lines 77 to 86
{
"command": "jupytercad:newCylinder",
"keys": ["Accel Alt C"],
"selector": ".jcad-Mainview"
},
{
"command": "jupytercad:newCylinder",
"keys": ["Accel Alt C"],
"selector": ".jpcad-sidepanel-widget"
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should introduce a data attribute in our components that should receive keybinding events, like data-jcad-keybinding or something. Then we could get rid of this duplication and just do something like:

  {
    "command": "jupytercad:newCylinder",
    "keys": ["Accel Alt C"],
    "selector": "[data-jcad-keybinding]"
  }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can try on it, thanks for suggesting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked, thanks @martinRenou.
Done in 2ddc2ed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I meant using a data attribute, not a class, have you tried that? But a general purpose class like you did sounds good too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I guess I misinterpreted the idea. I'd be happy to explore this option too if it's more viable.
Might be silly but I'd just want to confirm how do I add data attribute to the component?

@arjxn-py arjxn-py mentioned this pull request Oct 8, 2024
@SylvainCorlay SylvainCorlay merged commit 049220a into jupytercad:main Oct 11, 2024
10 checks passed
@arjxn-py arjxn-py deleted the keyboard-shortcuts branch October 11, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request UX improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redo keyboard short RFD: Proposal to Add Keybindings for Additional JupyterCAD Commands
3 participants